package cn.edu.hunan.pm.service;


import cn.edu.hunan.pm.Entity.Law;
import cn.edu.hunan.pm.mapper.LawMapper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class LawService {
    @Autowired
    private LawMapper lawMapper;

    public void addLaw(Law law) {
        lawMapper.insert(law);
    }

    public void deleteLawById(Integer lawId) {
        lawMapper.deleteById(lawId);
    }

    public void updateLaw(Law law) {
        lawMapper.update(law);
    }

//    public Law findLawById(Integer lawId) {
//        return lawMapper.findById(lawId);
//    }

    public List<Law> findAllLaws() {
        return lawMapper.findAll();
    }
}
